#!/usr/bin/perl

use lib::abs qw( .. );
use JIP::ToolSet; # load my commonly-used modules in a single import

use Test::More tests => 8;

use_ok 'FactoryMethod';
require_ok 'FactoryMethod';

can_ok 'FactoryMethod', qw( _isRequireError _isModuleName _makePathToFile );

{
    is(
        FactoryMethod->_makePathToFile('ClassBase'),
        'ClassBase.pm',
        '_makePathToFile(\'ClassBase\')'
    );

    is(
        FactoryMethod->_makePathToFile('Class:Base'),
        'Class:Base.pm',
        '_makePathToFile(\'Class:Base\')'
    );

    is(
        FactoryMethod->_makePathToFile('Class:::Base'),
        'Class/:Base.pm',
        '_makePathToFile(\'Class:::Base\')'
    );

    is(
        FactoryMethod->_makePathToFile('Class::Base'),
        'Class/Base.pm',
        '_makePathToFile(\'Class::Base\')'
    );

    is(
        FactoryMethod->_makePathToFile('Class::Accessor::Fast'),
        'Class/Accessor/Fast.pm',
        '_makePathToFile(\'Class::Accessor::Fast\')'
    );
}
